<?php
namespace app\common\model;

use think\Model;

class MonitorRule extends Model
{
    // 指定表名,不含前缀
    protected $name = 'monitor_rule';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    /**
     * @param array $arg
     * @param string $field
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getListByArg(array $arg,$field='*')
    {
        return $this->where($arg)->field($field)->select();
    }

    public function getListByArgOne(array $arg,$field='*')
    {
        return $this->where($arg)->field($field)->find();
    }
}
